//
//  MKcustomPinAnnotationView.m
//  UILbrary
//
//  Created by mac on 17/3/9.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "MKcustomPinAnnotationView.h"
#import "MKCustomViewController.h"
@interface MKcustomPinAnnotationView()
@property (nonatomic, strong) MKCustomViewController *customVC;
@end;
@implementation MKcustomPinAnnotationView


- (instancetype)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifie{
    if (self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifie]) {
        
        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
        button.backgroundColor = [UIColor orangeColor];
        [button setTitle:@"导航afalkjdfaldfl;lk" forState:UIControlStateNormal];
        [button addTarget:self action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
        
        self.customVC =[[MKCustomViewController alloc] init];
        self.customVC.titleArr = @[@"名字：陈文轩",
                                   @"速度：250/KM",
                                   @"时间：2017-03-07 16:30:30",
                                   @"时间：2017-03-07 16:35:30",
                                   @"地址：广东省深圳市龙岗区横岗数字硅谷"];
        UIView *callOutView = self.customVC.view;
        CGRect callOutViewBounds = CGRectMake(0, 0, 200, 250);
        callOutView.frame = callOutViewBounds;
        
        self.detailCalloutAccessoryView = callOutView;
        self.canShowCallout = YES;
    }
    return self;
}

- (void)buttonClick{
    NSLog(@"%s",__func__);
}
@end
